package com.tobby.camel.camelinaction.chapter2.recipientlist;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;

public class CalculateRecipients implements Processor {

	@Override
	public void process(Exchange exchange) throws Exception {
		String recipients = "jms:accounting";
		String customer = exchange.getIn().getHeader("customer", String.class);
		if (customer.equals("honda")) {
			recipients += ", jms:production";
		}
		exchange.getIn().setHeader("recipients", recipients);
	}

}
